import java.util.Random;
import java.util.Scanner;

public class shuzizhadan {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Random random = new Random();

        int zhadan = random.nextInt(100)+1;
        int left = 1;
        int right = 100;
        System.out.print("请输入数字(范围:"+ left + '-' + right +"):");
        int a = scanner.nextInt();

        while(a != zhadan) {
            if(a > zhadan) {
                right = a -1;
                System.out.print("猜大了,");
            } else {
                left = a + 1;
                System.out.print("猜小了,");
            }
            System.out.print("请重新输入数字(范围:"+ left + '-' + right +"):");
            a = scanner.nextInt();
        }

        System.out.println("猜中了，炸弹是 " + zhadan);
    }
}
